package IC.SymbolTable;

public abstract class RecursiveLookupSymbolTable extends SymbolTable {

	//C'tor
	public RecursiveLookupSymbolTable(String id,String DisplayId) {
		super(id,DisplayId);
	}

	@Override
	public Symbol lookup(String id, int AppOrder) {
		Symbol val = getValue(id);
		if (val == null || (val.getAppOrder() > AppOrder && AppOrder != NO_APPERANCE_ORDER)) {
			val = getParent().lookup(id,AppOrder);
		}
		return val;
	}
	
	@Override
	public Symbol staticLookup(String id) {
		return getParent().staticLookup(id);
	}
	

	@Override
	public Symbol virtualLookup(String id) {
		return getParent().virtualLookup(id);
	}
}
